import { http } from '../service';

// 查询项目中心
export function getUserGrantProjectlist(params: any) {
  return http.middleware({
    url: `/ctms/Rest/project/getUserGrantProjectlist`,
    method: 'GET',
    params,
  });
}
// 查询项目详情
export function getProjectDetails(params: any) {
  return http.middleware({
    url: `/project/Rest/projectBasic/projectDetails`,
    method: 'GET',
    params,
  });
}

// 获取项目统计信息
export function getProjectReport(params: any) {
  return http.middleware({
    url: `/ctms/Rest/projectHome/getProjectReport`,
    method: 'GET',
    params,
  });
}

// 查询项目成员
export function getOrgProjectUserList(params: any) {
  return http.middleware({
    url: `/system/Rest/user/getOrgProjectUserList`,
    method: 'GET',
    params,
  });
}

// 工作页任务 待反馈、已退回
export function workTaskList(params: any) {
  return http.middleware({
    url: `/ctms/Rest/project/task/workTaskList`,
    method: 'GET',
    params,
  });
}

// 工作页任务 待审批 已办
export function WorkFlowListByPage(params: any) {
  return http.middleware({
    url: `/ctms/Rest/pageWork/getWorkFlowList`,
    method: 'GET',
    params,
  });
}

// 查询任务基本信息
export function taskBaseInfo(taskId: any) {
  return http.middleware({
    url: `/ctms/Rest/project/task/getById`,
    method: 'GET',
    params: { taskId },
  });
}

// 查询任务的依赖关系
export function getCurrentTaskFrontTaskList(params: any) {
  return http.middleware({
    url: `/ctms/Rest/project/task/getCurrentTaskFrontTaskList`,
    method: 'GET',
    params,
  });
}

// 项目级-进度-文件清单 修改文件清单顺序
export function getTaskFileDetailList(params: any) {
  return http.middleware({
    url: `/ctms/Rest/projectFileListItem/detailList`,
    method: 'GET',
    params,
  });
}

// 项目级-阶段
export function getPhaseList(params: any) {
  return http.middleware({
    url: `/ctms/Rest/project/phase/list`,
    method: 'GET',
    params,
  });
}

// 获取里程碑任务列表
export function getMilestoneTaskList(params: any) {
  return http.middleware({
    url: `/ctms/Rest/projectHome/getMilestoneTaskList`,
    method: 'GET',
    params,
  });
}

// 查询预制角色和自定义角色(排序)
export function getRoleListSort(params: any) {
  return http.middleware({
    url: `/system/Rest/role/getRoleSortWeightList`,
    method: 'GET',
    data: params,
  });
}
// 添加根据手机号码精确查询用户列表
export function userPreciseQuery(mobile: any) {
  return http.middleware({
    url: `/system/Rest/user/userPreciseQuery`,
    method: 'GET',
    data: { mobile },
  });
}

// 添加项目成员
export function saveOrgProjectUser(params: any) {
  return http.middleware({
    url: `/system/Rest/user/saveOrgProjectUser`,
    method: 'POST',
    data: params,
  });
}

// 修改项目成员
export function updateOrgProjectUserAuth(params: any) {
  return http.middleware({
    url: `/system/Rest/user/updateOrgProjectUserAuth`,
    method: 'POST',
    data: params,
  });
}

// 任务反馈提交
export function taskFeedback(data: any) {
  return http.middleware({
    url: `/ctms/Rest/project/task/submit`,
    method: 'POST',
    data,
  });
}
// 合同列表
export function getContractList(params: any) {
  return http.middleware({
    url: `/ctms/Rest/projectContract/listByPage`,
    method: 'GET',
    params,
  });
}
// 付款登记
export function getPayRegisterList(params: any) {
  return http.middleware({
    url: `/ctms/Rest/projectPayment/registration/list`,
    method: 'GET',
    params,
  });
}

// 经费支出
export function getFundExpendList(params: any) {
  return http.middleware({
    url: `/ctms/Rest/projectFundExpend/list`,
    method: 'GET',
    params,
  });
}
// 经费调整
export function getFundAdjustList(params: any) {
  return http.middleware({
    url: `/ctms/Rest/projectFundAdjust/list`,
    method: 'GET',
    params,
  });
}
